package file;

import java.io.File;

public class Demo3 {
    public static void main(String[] args) throws InterruptedException {
        File file = new File("./test.txt");
        //file.delete();
        file.deleteOnExit();//程序退出再删除,不会立即删除

        Thread.sleep(5000);
    }
}
